package com.arpa.oms.domain.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.arpa.oms.domain.enums.OrderStatusEnum;
import com.arpa.oms.domain.enums.PurchaseTypeEnum;
import com.arpa.wms.domain.entity.BasicEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * OMS采购单Dto
 * </p>
 *
 * @author LEO
 * @since 2020-10-22
 */
@Data
@ApiModel(value = "OmsPurchaseDto对象", description = "OMS采购单Dto")
public class PurchaseVo extends BasicEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "采购单号")
    private String code;

    @ApiModelProperty(value = "来源单号")
    private String sourceCode;

    @ApiModelProperty(value = "所属机构Code")
    private String groupCode;

    @ApiModelProperty(value = "仓库code")
    private String warehouseCode;

    @ApiModelProperty(value = "仓库名称")
    private String warehouseName;

    @ApiModelProperty(value = "货主code")
    private String shipmentCode;

    @ApiModelProperty(value = "货主名称")
    private String shipmentName;

    @ApiModelProperty(value = "采购类型 normal:普通采购")
    private PurchaseTypeEnum purchaseType;

    @ApiModelProperty(value = "供应商code")
    private String supplierCode;

    @ApiModelProperty(value = "供应商名称")
    private String supplierName;

    @ApiModelProperty(value = "计划到货日期")
    private LocalDate gmtPlanArrival;


    @ApiModelProperty(value = "计划采购数量（采购单位）")
    private BigDecimal planQuantity;

    @ApiModelProperty(value = "计划采购数量（基本单位）")
    private BigDecimal planBasicQuantity;

    @ApiModelProperty(value = "实际采购数量（采购单位）")
    private BigDecimal actualQuantity;

    @ApiModelProperty(value = "实际采购数量（基本单位）")
    private BigDecimal actualBasicQuantity;

    @ApiModelProperty(value = "付款金额")
    private BigDecimal paymentAmount;

    @ApiModelProperty(value = "已使用付款金额，用于批次生成付款明细时，计算已使用的付款金额数量")
    private BigDecimal usePaymentAmount;

    @ApiModelProperty(value = "欠款金额")
    private BigDecimal owedAmount;

    @ApiModelProperty(value = "状态：新增、作废、待审核、审核通过、审核未通过")
    private OrderStatusEnum status;

    @ApiModelProperty(value = "备注")
    private String remarks;


    @ApiModelProperty(value = "审核意见")
    private String verifyOpinion;

    @ApiModelProperty(value = "审核人标识")
    private String verifyBy;

    @ApiModelProperty(value = "审核人姓名")
    private String verifyName;

    @ApiModelProperty(value = "总数")
    private Long total;

    @ApiModelProperty(value = "审核时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime gmtVerify;

    @ApiModelProperty(value = "采购明细")
    private List<PurchaseItemVO> purchaseItemList;
}
